<?php
function createFile($f) {
	$filename = $f ? $f : "/var/adpv6/marin_link/phpcreate.txt";

	$_doc = "アカウント\tbasd\tasdad\nasdsd\tas\adsd".'\n'."asdad";

	$enc = mb_detect_encoding($_doc, 'ASCII,JIS,UTF-8,EUC-JP,SJIS');

	echo "<br />";
	echo 'mb_detect_encoding($_doc, "ASCII,JIS,UTF-8,EUC-JP,SJIS")' . ' => '. $enc;

	//$_doc = mb_convert_encoding($_doc, "Unicode", $enc);

	$fp = @fopen($filename, ($append ? 'a' : 'w'));
	if($fp) {
		$a = @fwrite($fp, $_doc);
		@fclose($fp);
	}
	echo "<br />-------------ghi file --------<br>";
	if($a === false) echo '===false';
	elseif ($a==='') echo 'empty';
	else echo '$a = '. gettype($a) ;

	echo gettype($fp);
	echo "<br />------------ ghi file--------<br>";
	echo 'fp';
	echo "<br />------------ ghi file--------<br>";

}
